package com.snopy.jvm.heap;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * @author snopy
 * @version 1.0.0
 * @classname DemoMemoryUsage
 * @description
 * -XX:NativeMemoryTracking=detail -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMTStatistics
 *
 * 堆初始大小：-Xms -XX:InitialHeapSize=size
 * 堆最大内存：-Xmx 或-XX:MaxHeapSize=size
 * 堆新生代大小：-Xmn | -XX:NewSize=size + -XX:MaxNewSize=size
 * 幸存区比例：-XX:InitialSurvivorRatio=ratio -XX:+UseAdaptiveSizePolicy
 * 幸存区比例：-XX:SurvivorRatio=ratio
 *
 * 晋升阈值：-XX:MaxTenuringThreshold=threshold
 * 晋升详情: -XX:+PrintTenuringDistribution
 * GC详情：-XX:+PrintGCDetails -verbose:gc
 * FullGC前MinorGC -XX:+ScavengeBeforeFullGC
 *
 * -XX:+UseSerialGC
 * @email 77912204@qq.com
 * @date 2022/07/04 14:30
 */
@Slf4j
public class DemoMemoryUsage {
    private static int _1M = 1024*1024;
    public static void main(String[] args) {
        byte[] bytes = new byte[_1M];

    }
}
